package thread;

public class ThreadDemo1 {
    public static void main(String[] args) {
       MyThread1 m1=new MyThread1();
       MyThread2 m2=new MyThread2();
       //调用thread中的start()方法，让线程自动运行run()方法
       m1.start();
       m2.start();
    }
}


class MyThread1 extends Thread{
    public void run(){
        for(int i=0;i<1000;i++){
            System.out.println("Who are you?");
        }
    }
}




class MyThread2 extends Thread{
    public void run(){
        for(int i=0;i<1000;i++){
            System.out.println("Open the door, dady");
        }
    }
}



